#!/usr/bin/env node

const { program } = require("commander");
const { version } = require("./package.json");
const compress = require("./cmds/compress");

program
  .name("tinypng")
  .usage("<command> [options]")
  .version(version, "-v, --version")
  .helpOption("-h, --help", "output usage information")
  .command("key", "manage tinypng keys", { executableFile: "cmds/key" })
  .addHelpCommand(false)
  .addHelpText(
    "after",
    "\n  Run tinypng <command> --help for detailed usage of given command."
  )
  .action(compress);

program.parse(process.argv);
